package coursework.receivers;

import java.io.BufferedReader;

public class UserInputThread extends Thread {

	private Receiver client;
	private BufferedReader userIn;
	
	public UserInputThread(Receiver client, BufferedReader userIn) {
		this.client = client;
		this.userIn = userIn;
	}
	
	@Override
	public void run() {
		while(true){
			try{
				String message = userIn.readLine();
				client.addUserMessage(message);
			}catch(Exception e){
				e.printStackTrace();
			}
			Thread.yield();
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
